package discov

func DefaultOptions() *Options {
	return &Options{
		kind:      "etcd",
		addr:      []string{"127.0.0.1:2379"},
		keepAlive: 60,
	}
}

type Options struct {
	kind      string
	addr      []string
	keepAlive int
}

func (ts *Options) SetKind(v string) *Options {
	ts.kind = v
	return ts
}

func (ts *Options) SetAddr(v []string) *Options {
	ts.addr = v
	return ts
}

func (ts *Options) SetKeepAlive(v int) *Options {
	if v <= 0 {
		v = 10
	}
	ts.keepAlive = v
	return ts
}
